﻿<Windows:BookvarToolWindow
	x:Class="BookvarWpf.Windows.AddNotesWindow"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:aw="clr-namespace:Assergs.Windows;assembly=Assergs.Windows"
	xmlns:commands="clr-namespace:Bookvar.UI.Commands;assembly=Bookvar.UI"
	xmlns:Windows="clr-namespace:BookvarWpf.Windows;assembly="
  xmlns:r="clr-namespace:Bookvar.UI.Localization;assembly=Bookvar.UI"
	Header="{r:Resources NotesHeaderText}"
	Icon="pack://application:,,,/BookvarWPF;component/Resources/Icons/16x16/ProtocolsQuery16.png"
	Style="{DynamicResource {x:Type aw:ToolWindow}}"
	Width="570"
	Height="585"
	MinWidth="570"
	MinHeight="585"
	>
    <Windows:BookvarToolWindow.InputBindings>
        <KeyBinding Command="aw:ToolWindow.CloseCommand" Key="Escape" />
    </Windows:BookvarToolWindow.InputBindings>
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.964,0.801" StartPoint="0.139,0.133" SpreadMethod="Reflect">
                <GradientStop Color="#FF5B9BD2" Offset="0"/>
                <GradientStop Color="#FFFFFFFF" Offset="0.845"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Grid.Resources>
            <Style TargetType="{x:Type Button}" x:Key="formatTextStyle">
                <Setter Property="FontFamily" Value="Palatino Linotype"></Setter>
                <Setter Property="Width" Value="30"></Setter>
                <Setter Property="FontSize" Value ="14"></Setter>
                <Setter Property="CommandTarget" Value="{Binding ElementName=notes}"></Setter>
            </Style>
            <Style TargetType="{x:Type Button}" x:Key="formatImageStyle">
                <Setter Property="Width" Value="30" />
                <Setter Property="CommandTarget" Value="{Binding ElementName=notes}" />
            </Style>

        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <ToolBar Margin="3,5,3,5" Height="30">
            <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Cut" ToolTip="Cut" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/EditCut.png" />
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Copy" ToolTip="Copy" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/EditCopy.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Paste" ToolTip="Paste" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/EditPaste.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Undo" ToolTip="Undo" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/EditUndo.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="ApplicationCommands.Redo" ToolTip="Redo" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/EditRedo.png"></Image>
            </Button>

            <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleBold" ToolTip="Bold" Focusable="False">
                <TextBlock FontWeight="Bold">B</TextBlock>
            </Button>
            <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleItalic" ToolTip="Italic" Focusable="False">
                <TextBlock FontStyle="Italic" FontWeight="Bold">I</TextBlock>
            </Button>
            <Button Style="{StaticResource formatTextStyle}" Command="EditingCommands.ToggleUnderline" ToolTip="Underline" Focusable="False">
                <TextBlock TextDecorations="Underline" FontWeight="Bold">U</TextBlock>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseFontSize" ToolTip="Grow Font" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/CharacterGrowFont.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseFontSize" ToolTip="Shrink Font" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/CharacterShrinkFont.png"></Image>
            </Button>

            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleBullets" ToolTip="Bullets" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ListBullets.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.ToggleNumbering" ToolTip="Numbering" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ListNumbering.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignLeft" ToolTip="Align Left" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ParagraphLeftJustify.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignCenter" ToolTip="Align Center" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ParagraphCenterJustify.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignRight" ToolTip="Align Right" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ParagraphRightJustify.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.AlignJustify" ToolTip="Align Justify" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ParagraphFullJustify.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.IncreaseIndentation" ToolTip="Increase Indent" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ParagraphIncreaseIndentation.png"></Image>
            </Button>
            <Button Style="{StaticResource formatImageStyle}" Command="EditingCommands.DecreaseIndentation" ToolTip="Decrease Indent" Focusable="False">
                <Image Source="pack://application:,,,/BookvarWPF;component/Resources/Icons/Toolbar/ParagraphDecreaseIndentation.png"></Image>
            </Button>

        </ToolBar>
        <RichTextBox Grid.Row="1" x:Name="notes" Background="{StaticResource RichTextBoxBackgroundBrush}" BorderBrush="#7FFFB430" BorderThickness="4,4,4,4" 
               ScrollViewer.CanContentScroll="True" AcceptsTab="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <FlowDocument >
                <Paragraph RenderOptions.BitmapScalingMode="HighQuality" />
            </FlowDocument>
        </RichTextBox>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" FocusManager.IsFocusScope="True" Grid.Row="2">
            <Button x:Name="btnOk" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,6,15,6" 
                Click="OnOkClick" Command="commands:BookvarCommands.SaveNotes"
                Height="22" BorderBrush="#FF536B88" Background="{StaticResource BlueButtonStyleBrush}"
                Content="{r:Resources OkDefaultText}" />
            <Button BorderBrush="#FF536B88" HorizontalAlignment="Center" 
                VerticalAlignment="Center" Margin="10,6,15,6" Command="aw:ToolWindow.CloseCommand" Height="22" 
                Background="{StaticResource BlueButtonStyleBrush}"
                Content="{r:Resources CancelDefaultText}" />
        </StackPanel>
    </Grid>
</Windows:BookvarToolWindow>